 <?php
header("content-type:text/html;charset=utf-8");
echo "这是一个"."字符串<br>";
$t="学校";
print "我在.$t.学习php<br>";
$x=9559.546;
var_dump($x); //int(9559)
print($x);    //9559

$y = true; // 十六进制数
echo $y;
var_dump($y);

$arr=array("a","b","c");
echo "print_r输出数组:";
print_r($arr);
echo "<br>";
var_dump($arr);

echo "<br>";
echo "------------------------------------------------------------------------------------------------<br>";
define("NAME","caichuang");
echo strpos("Hello world!","world");  //6  第一个world中w的位置,从0开始算
echo date("Y-m-d H:i:s");

echo "------------------------------------------------------------------------------------------------<br>";
$arra=array("a","b","c");
for($i=0;$i<count($arra);$i++){

	echo $arra[$i]."<br>";
}
echo "------------------------------------------------------------------------------------------------<br>";


$info=array("张三"=>"14岁","李四"=>"15","王五"=>"16");


// exit;
foreach($info as $k=>$v){

echo "key:".$k.";value:".$v."<br>";
}

echo "------------------------------------------------------------------------------------------------<br>";
function add($x,$y){

	$z=$x+$y;
	return $z;
}
echo add(1,2);
echo __LINE__."<br>";
echo __FILE__."<br>";
echo __DIR__."<br>";
// echo 123."PHP_EOL";
echo 123;


----------------------------------------

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>layout后台布局 - Layui</title>
<link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <!-- 头部区域（可配合layui已有的水平导航） -->
  </div>
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
    </div>
  </div>
  <div class="layui-body">
    <!-- 内容主体区域 -->
  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
  </div>
</div>
<script src="../layui/layui.js"></script>
<script>
//JavaScript代码区域
</script>
</body>
</html>
.....................................................
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="./layui/css/layui.css">
  <style type="text/css">
   body{
      background-image: url(./layui/images/3.jpg);
      background-attachment:fixed;
      background-size: cover;
    }
 .header{
  width: 90%;

  margin: 0 auto;
  overflow: hidden;
  text-align: center;
 }
 .maxdiv{
  width: 90%;
  margin: 0 auto;
 }
 .header a{
 float: right;
 margin-right:20px;
 }
 .header h1{
  display: inline;
  font-size: 30px;
  text-align: center;
  
 }

  </style>
</head>
<body>
  <div class="maxdiv">
   <div class="header">
   <h1>博客系统首页</h1>
     <a href="log.html" class="layui-btn ">登入</a>
     <a href="register.html" class="layui-btn ">注册</a>
   </div> 

   <div class="mine-left">
   <ul class="layui-nav layui-nav-tree" lay-filter="demo">
    <li class="layui-nav-item layui-nav-itemed">
      <a href="javascript:;">默认展开</a>
      <dl class="layui-nav-child">
        <dd><a href="javascript:;">选项一</a></dd>
        <dd><a href="javascript:;">选项二</a></dd>
        <dd><a href="javascript:;">选项三</a></dd>
        <dd><a href="javascript:;">选项四</a></dd>
        <dd><a href="javascript:;">选项五</a></dd>
        <dd><a href="javascript:;">选项六</a></dd>
        <dd><a href="log.">跳转项</a></dd>
      </dl>
    </li>
  
    </ul>
   </div>


  </div>
</body>
</html>
<script src="./layui/layui.js"></script>
<script>
layui.use('element', function(){
  var element = layui.element(); //导航的hover效果、二级菜单等功能，需要依赖element模块
  
  //监听导航点击
  element.on('nav(demo)', function(elem){
    //console.log(elem)
    layer.msg(elem.text());
  });
});
</script>

?>
